<template>
  <div class="vuex">
    <h1>我是父组件</h1>
    <button @click="sendMsg">向子组件传参</button>
    <Vuex></Vuex>
  </div>
</template>

<script setup>
    import { ref, reactive, toRefs, onBeforeMount, onMounted, watchEffect, computed } from 'vue';
    import Vuex from '../../components/vuex';
    import { useStore } from 'vuex';
    let store = useStore();
    const sendMsg = ()=>{
        store.commit('GET_DATA','我是父组件传递过来的');
    }
</script>
<style scoped>
    .vuex{
        width: 500px;
        height: 500px;
    }
</style>